<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    // 数组
    // let arr = [1,2,3,4,5];
    // let [a,b,c,d,e] = arr;
    // console.log( a,b,c,d,e );

    // 对象
    // let obj = {name : "王银浩", sex : 18}
    // let {name : f, sex : g} = {name : "王银浩", sex : 18}
    // console.log( f,g );


    // 小练习
    // let [x = 1, y = x] = []; //1,1
    // let [x = 1, y = x] = [2]; // 2,2
    // let [x = 1, y = x] = [1,2];  //1,2
    // let [x = y, y = 1] = [];  //报错
    // console.log(x,y);


    // 函数
    // function fn([a,b,c]){
    //     console.log(a + b + c);
    // }
    
    // fn([1,2,3])


    // 作业
    //1）复杂对象的解构
    // let obj = {
    // infos: [
    // { name: "zhangsan", age: 22, score: [100, 90, 80] },
    // { name: "lisi", age: 18, score: [80, 70, 80] },
    // ],
    // };

    // let {infos:[{name},{age,score:[,c]}]} = obj
    // console.log(name,age,c);
    //声明变量name值为zhangsan
    //声明变量age 值为18


    // rest
    // function rest(...a){
    //     console.log(a);
    // }
    // rest(1,2,3,4,5);


    // 箭头函数
    // let hanshu = (a,b) => ({name:a,sex:b});
    // console.log(hanshu(1,2));


    
</script>